package top.lixunda.ecommerce.server.user.api.feign;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import top.lixunda.commerce.common.core.config.FeignConfig;
import top.lixunda.commerce.common.core.constants.ServiceIds;
import top.lixunda.commerce.common.core.entity.MessageObject;
import top.lixunda.ecommerce.server.user.api.entity.db.UserAddressDO;

/**
 * 获取用户地址信息
 *
 * @author Xumda
 * @version time:2020/2/25 10:32
 */
@SuppressWarnings("unused")
@Api("获取用户地址信息")
@FeignClient(value = ServiceIds.MIDDLE_USER, configuration = FeignConfig.class)
@RequestMapping("/feign/user_address")
public interface IFeignUserAddressController {

    /**
     * 根据id查询地址信息
     *
     * @param id 用户地址id
     * @return 用户地址，不存在返回null
     */
    @ApiOperation("根据id查询地址信息")
    @GetMapping("queryAddressById")
    MessageObject<UserAddressDO> queryAddressById(@RequestParam("id") Long id);

}
